package com.xuchen.zhenyang.service.impl;

import com.xuchen.zhenyang.mapper.statistics.StatisticsMapper;
import com.xuchen.zhenyang.model.statistics.StatisticsDeliveryQueryModel;
import com.xuchen.zhenyang.model.statistics.StatisticsGoodsSaleModel;
import com.xuchen.zhenyang.model.statistics.StatisticsUserGoodsModel;
import com.xuchen.zhenyang.model.statistics.StatisticsUserGoodsQuery;
import com.xuchen.zhenyang.service.StatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

@Service
public class StatisticsServiceImpl implements StatisticsService {

    @Autowired
    StatisticsMapper statisticsMapper;

    @Override
    public List<StatisticsGoodsSaleModel> getMonthGoodsSale(Integer monthTime, Integer goodsType){
        return statisticsMapper.getMonthGoodsSale(monthTime,goodsType);
    }

    @Override
    public void refreshGoodsSale() {
        statisticsMapper.refreshGoodsSale();
    }

    @Override
    public void refreshUserOrder() {
        statisticsMapper.refreshUserOrder();
    }

    @Override
    public void refreshUserDebt() {
        statisticsMapper.refreshUserDebt();
    }

    @Override
    public BigDecimal getSumDelivery(StatisticsDeliveryQueryModel queryModel) {
        return statisticsMapper.getSumDelivery(queryModel);
    }

    @Override
    public List<StatisticsUserGoodsModel> getUserGoods(StatisticsUserGoodsQuery queryModel) {

        return statisticsMapper.getUserGoods(queryModel);
    }

}
